<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>9-12练习</title>
</head>
<body>
    <script>
        //输入两个数
        var na = prompt("请输入第一个要运算的数：");
        var nb = prompt("请输入第二个要运算的数：");
        //两个数进行变量转换并运算
        var num = Number(na)+Number(nb);
        console.log(num);
        document.write(num);
        alert(num);
    </script>
</body>
</html>